package com.tc168.cp306.b06.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.EditText;

import com.tc168.cp306.b06.MyApplication;
import com.tc168.cp306.b06.R;
import com.tc168.cp306.b06.bean.User;
import com.tc168.cp306.b06.gen.UserDao;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class psersionActivity extends AppCompatActivity {

    @BindView(R.id.tilte)
    EditText tilte;
    @BindView(R.id.counet)
    EditText counet;
    @BindView(R.id.tpynum)
    EditText tpynum;
    @BindView(R.id.isbuuton)
    Button isbuuton;
    private UserDao userDao;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_psersion);
        ButterKnife.bind(this);

        userDao = MyApplication.getmDaoSession().getUserDao();
    }

    @OnClick(R.id.isbuuton)
    public void onViewClicked() {

        User personbeanadd = new User(null, tilte.getText().toString(), counet.getText().toString(), "", tpynum.getText().toString(), "上海", false);
        userDao.insert(personbeanadd);
    }
}
